<template>
  <div>我是app</div>
  <div>{{ car }}</div>
</template>

<script>
import {
  ref,
  readonly,
  reactive,
  isReactive,
  isRef,
  isReadonly,
  isProxy,
} from "vue";
export default {
  name: "App",
  setup() {
    const car = reactive({
      name: "奔驰",
      price: "40万",
      color: "red",
    });

    const isShowDemo = ref(true);

    const car2 = readonly(car);

    console.log("\r\n------------isShowDemo isRef--------------\r\n");
    console.log(isRef(isShowDemo));
    console.log("\r\n------------isShowDemo isRef--------------\r\n");

    console.log("\r\n------------car isReactive--------------\r\n");
    console.log(isReactive(car));
    console.log("\r\n------------car isReactive--------------\r\n");

    console.log("\r\n------------car isProxy--------------\r\n");
    console.log(isProxy(car));
    console.log("\r\n------------car isProxy--------------\r\n");

    console.log("\r\n------------car2 isReadonly--------------\r\n");
    console.log(isReadonly(car2));
    console.log("\r\n------------car2 isReadonly--------------\r\n");

    console.log("\r\n------------car2 isProxy--------------\r\n");
    console.log(isProxy(car2));
    console.log("\r\n------------car2 isProxy--------------\r\n");

    return {
      car,
    };
  },
};
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
